Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds a new Changes
Sequence DiagramsequenceDiagram
participant User as User/CLI
participant Bundle as Egg-Bin Bundle Command
participant Bundler as `@eggjs/egg-bundler`
participant FS as Filesystem
User->>Bundle: run `egg-bin bundle` with flags
Bundle->>Bundle: resolve base/output/manifest paths\nvalidate mode, parse externals, determine framework
Bundle->>Bundle: debug-log options
Bundle->>Bundler: dynamic import then call `bundle(options)`
Bundler->>FS: write bundled files & manifest
Bundler-->>Bundle: return { outputDir, manifestPath, files }
Bundle-->>User: print bundle summary (dir, file count, manifest)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
There was a problem hiding this comment.
Code Review
This pull request introduces a new bundle command to the egg-bin tool, enabling the packaging of Egg.js applications into deployable artifacts via @eggjs/egg-bundler. The implementation includes a new command class with support for output directories, manifest paths, and build modes. Feedback recommends utilizing getFrameworkPath from @eggjs/utils to ensure consistent and correct framework path resolution across different environments.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a new bundle subcommand to egg-bin as a thin oclif wrapper around @eggjs/egg-bundler.bundle() and exposes it via package exports.
Changes:
- Introduces
tools/egg-bin/src/commands/bundle.tsimplementing the newbundlecommand and flags. - Re-exports the
Bundlecommand fromtools/egg-bin/src/index.ts. - Adds
@eggjs/egg-bundlerdependency and exports for the new command entrypoint intools/egg-bin/package.json.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| tools/egg-bin/src/index.ts | Re-exports the new Bundle command from the package entrypoint. |
| tools/egg-bin/src/commands/bundle.ts | Implements the bundle oclif command wrapping @eggjs/egg-bundler. |
| tools/egg-bin/package.json | Adds dependency and export paths for the new bundle command. |
Deploying egg-v3 with
|
| Latest commit: |
5db1226
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://11ec5857.egg-v3.pages.dev |
| Branch Preview URL: | https://split-17-egg-bin-bundle-cmd.egg-v3.pages.dev |
0f2e7ca to
ec61bad
Compare
Deploying egg with
|
| Latest commit: |
5db1226
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://efb9b14a.egg-cci.pages.dev |
| Branch Preview URL: | https://split-17-egg-bin-bundle-cmd.egg-cci.pages.dev |
b54fb4c to
77295b4
Compare
ec61bad to
5fb9bfc
Compare
77295b4 to
ccb1b56
Compare
5fb9bfc to
c987d7c
Compare
ccb1b56 to
bb07df4
Compare
d0f4b08 to
c987d7c
Compare
bb07df4 to
ccb1b56
Compare
c987d7c to
e340159
Compare
e340159 to
005b155
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## next #5888 +/- ##
==========================================
- Coverage 85.53% 85.03% -0.51%
==========================================
Files 662 665 +3
Lines 18888 19100 +212
Branches 3664 3716 +52
==========================================
+ Hits 16156 16241 +85
- Misses 2359 2466 +107
- Partials 373 393 +20 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds a new egg-bin bundle CLI command that wraps @eggjs/egg-bundler.bundle() so apps can be bundled via the standard Egg developer toolchain.
Changes:
- Introduce a new oclif command
bundlewith flags for output, manifest, framework, mode, tegg, and external overrides. - Export the new command from
tools/egg-bin/src/index.ts. - Add
@eggjs/egg-bundleras a runtime dependency and expose the new command via package exports.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tools/egg-bin/src/index.ts | Re-exports the new Bundle command alongside existing commands. |
| tools/egg-bin/src/commands/bundle.ts | New oclif command implementation that parses flags and calls @eggjs/egg-bundler.bundle(). |
| tools/egg-bin/package.json | Adds exports for the new command and adds @eggjs/egg-bundler dependency. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tools/egg-bin/test/commands/bundle.test.ts (1)
45-77: ⚡ Quick winAdd explicit
--frameworkoverride coverage.This case validates most flags, but
--frameworkoverride behavior is still untested. Adding one focused assertion for that flag would close the new command’s flag matrix.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tools/egg-bin/test/commands/bundle.test.ts` around lines 45 - 77, Add a test variation that passes an explicit --framework flag to Bundle.run and assert bundleMock received the framework path built from getFrameworkPath for that override; specifically update the existing test invocation of Bundle.run to include '--framework', 'my-framework' (or add a new it block) and change/extend the expect(bundleMock).toHaveBeenCalledWith to verify the framework property equals getFrameworkPath({ framework: 'my-framework', baseDir }) while keeping other expected options the same; reference Bundle.run, bundleMock, and getFrameworkPath to locate where to modify the args and assertion.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@tools/egg-bin/test/commands/bundle.test.ts`:
- Around line 45-77: Add a test variation that passes an explicit --framework
flag to Bundle.run and assert bundleMock received the framework path built from
getFrameworkPath for that override; specifically update the existing test
invocation of Bundle.run to include '--framework', 'my-framework' (or add a new
it block) and change/extend the expect(bundleMock).toHaveBeenCalledWith to
verify the framework property equals getFrameworkPath({ framework:
'my-framework', baseDir }) while keeping other expected options the same;
reference Bundle.run, bundleMock, and getFrameworkPath to locate where to modify
the args and assertion.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 3b834fde-2d7f-4a6f-9e07-389aec9b2a71
📒 Files selected for processing (1)
tools/egg-bin/test/commands/bundle.test.ts
Thin wrapper over
@eggjs/egg-bundler.bundle()using @oclif/core. Exposes--output/--manifest/--framework/--mode/--no-tegg/--force-external/--inline-external. Re-exports fromsrc/index.tsso tsdown's unused-dep check sees the@eggjs/egg-bundlerdependency.Part of #5863 split. Tracking: #5871.
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Tests
Chores